import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLoginOpen: false,
    isRegisterOpen: false,
    isLogin: false,
  },
  mutations: {
    ToggleLoginOpen (state, isLoginOpen) {
      state.isLoginOpen = isLoginOpen
      if (isLoginOpen) {
        state.isRegisterOpen = false
      }
    },
    ToggleRegisterOpen (state, isRegisterOpen) {
      state.isRegisterOpen = isRegisterOpen
      if (isRegisterOpen) {
        state.isLoginOpen = false
      }
    },
    ToggleLoginState (state, isLogin) {
      state.isLogin = isLogin
    },
  },
  actions: {
  },
  modules: {
  }
})
